home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9764 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: lantana.singnet.com.sg!usenet
  2. From: mikhail@singnet.com.sg (Mikhail Choo W.M.)
  3. Newsgroups: comp.lang.c++
  4. Subject: how to delete data in file? help
  5. Date: Tue, 05 Mar 1996 03:53:11 GMT
  6. Organization: Singapore Telecom Internet Service
  7. Message-ID: <4helpk$50c@lantana.singnet.com.sg>
  8. NNTP-Posting-Host: ts900-2823.singnet.com.sg
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11. HI there,
  12.    I know this may seem like a real stupid question, but I had to ask. If say
  13. for example I needed to delete a string of data form a file, how do I go about
  14. doing it. I can't just write over the data to delete, because the result would
  15. be a file of the same length with white space chracters. So how does one delete
  16. the data in such a way that once the data segment is deleted, the rest of the
  17. data would neatly pack themselves over the deleted area to  ensure a release of
  18. space. I know one way to solve the problem, but it seems very long-winded. The
  19. method involves reading all the data in the file to memory, deleteing the
  20. unwanted area, and the re-write the data back to clean file. I am currently
  21. using Borland C++ 4.5, and I can't find any function that does the job. OK OK,
  22. to summerise, the problem is that I can't seem to find a way to directly delete
  23. a data segment form a file, without reading into memory first. So any ideas, and
  24. help would be greatly appreciated. Thanks in advance .
  25. --------------------------------------------------------
  26. Yours, Mikhail Choo W. M.            
  27.                                    Carpedium!
  28. E-Mail: mikhail@singnet.com.sg        sieze the day...  
  29.         s7700017@singnet.com.sg
  30. -------------------------------------------------------- 
  31.  
  32.